import jsonschema
# integer —— 整数
data1=100
schema1 = {"type": "integer"}
# string —— 字符串
data2='哈哈'
schema2 = {"type": "string"}
# object —— 对象
data3={"编号":"2"}
schema3 = {"type": "object"}
# null —— 空值
data4=None
schema4= {"type": "null"}
# boolean —— 布尔值
data5=True
schema5= {"type": "boolean"}

res1=jsonschema.validate(instance=data1, schema=schema1)
print(res1)
res2=jsonschema.validate(instance=data2, schema=schema2)
print(res2)
res3=jsonschema.validate(instance=data3, schema=schema3)
print(res3)
res4=jsonschema.validate(instance=data4, schema=schema4)
print(res4)
res5=jsonschema.validate(instance=data5, schema=schema5)
print(res5)

